Update TAR guidance for untrusted archives - #54670
Open
mangod9 wants to merge 4 commits into
Open
Conversation
…ributes Adds security guidance to the ZIP/TAR best-practices article for handling untrusted TAR archives: - A note that destination boundary validation assumes the destination is a real directory the app controls; a junction/symlink destination (or parent) causes extraction to follow the link, even with TarFile.ExtractToDirectory. - A new section on PAX extended attributes and link names as untrusted, archive-supplied input that can override header fields. - Updated the untrusted-metadata checklist item to include link names and PAX extended attributes. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the archive security best-practices guidance to cover TAR-specific risks when extracting untrusted archives, complementing the existing ZIP guidance.
Changes:
- Adds a note clarifying the limits of destination boundary validation when the destination path contains junctions or symlinks.
- Documents TAR PAX extended attributes and TAR link names as untrusted metadata that requires validation and limits.
- Updates the best-practices checklist to explicitly include TAR link names and PAX extended attributes.
gewarren
approved these changes
Jul 8, 2026
Co-authored-by: Genevieve Warren <[email protected]>
Member
Author
|
@copilot can you please apply the review suggested text changes? |
Co-authored-by: Copilot <[email protected]>
GrabYourPitchforks
requested changes
Jul 8, 2026
…chive note The note lives in the streaming/untrusted-input section, but referenced TarFile.ExtractToDirectory, which the article frames as a trusted-input convenience API. Reword to keep the note focused on manual boundary validation and avoid the inconsistency. Co-authored-by: Copilot <[email protected]>
gewarren
enabled auto-merge (squash)
July 29, 2026 17:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updating the ZIP/TAR best-practices docs with security guidance for TAR API use: destination boundary validation, PAX extended attributes, and link names.
Internal previews